<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="admin/css/pearForm.css" />
		<link rel="stylesheet" href="component/layui/css/layui.css" />
		<link rel="stylesheet" href="admin/css/pearButton.css" />
		<link rel="stylesheet" href="assets/login.css" />
	</head>
	<body background="admin/images/background.svg">
	    <form class="layui-form" action="javascript:void(0);">
			<div class="layui-form-item">
				<img class="logo" src="admin/images/logo.png" />
				<div class="title">个人综合管理系统</div>
				<div class="desc">
					为努力有梦想的人,提供最好的工具
				</div>
			</div>
            <div class="layui-form-item">
				<input placeholder="账 户 : admin" hover class="layui-input" id="username" />
			</div>
			<div class="layui-form-item">
				<input placeholder="密 码 : 888888" hover class="layui-input" id="password" type="password" />
			</div>
			<div class="layui-form-item">
				<input type="checkbox" name="" title="记住密码" lay-skin="primary" checked>
			</div>
            <div class="layui-form-item">
				<button style="background-color: #5FB878!important;" class="pear-btn pear-btn-primary login">
					登 入
				</button>
			</div>
		</form>
		<script src="component/layui/layui.js"></script>
		<script>
			layui.use(['form', 'element','jquery'], function() {
				var from = layui.form;
				var element = layui.element;
				var $ = layui.jquery;

				$("body").on("click",".login",function(){
					// http://localhost/login/login
					const parms = {
						username: $("#username").val(),
						password: $("#password").val()
					};
					console.log(parms)
					$.post("../login/login",parms,function(data){
						console.log(data)
						if (data.state === 200){
							location.href="index.html"
						}else{
							alert('异常')
						}
					});
				})
			})
		</script>
	</body>
</html>
